<!--
  智慧社区管理系统 - 投诉建议统计分析页面
  @author Wu.Liang
  @date 2025-01-27
-->
<template>
  <div class="complaint-statistics">
    <el-card>
      <template #header>
        <div class="card-header">
          <span>投诉统计分析</span>
          <el-button type="primary" @click="handleRefresh">刷新数据</el-button>
        </div>
      </template>
      
      <div class="statistics-content">
        <el-row :gutter="20">
          <el-col :span="6">
            <el-card class="stat-card">
              <div class="stat-item">
                <div class="stat-number">{{ totalComplaints }}</div>
                <div class="stat-label">总投诉数</div>
              </div>
            </el-card>
          </el-col>
          <el-col :span="6">
            <el-card class="stat-card">
              <div class="stat-item">
                <div class="stat-number">{{ pendingComplaints }}</div>
                <div class="stat-label">待处理</div>
              </div>
            </el-card>
          </el-col>
          <el-col :span="6">
            <el-card class="stat-card">
              <div class="stat-item">
                <div class="stat-number">{{ processingComplaints }}</div>
                <div class="stat-label">处理中</div>
              </div>
            </el-card>
          </el-col>
          <el-col :span="6">
            <el-card class="stat-card">
              <div class="stat-item">
                <div class="stat-number">{{ completedComplaints }}</div>
                <div class="stat-label">已完成</div>
              </div>
            </el-card>
          </el-col>
        </el-row>
        
        <el-row :gutter="20" style="margin-top: 20px;">
          <el-col :span="12">
            <el-card>
              <template #header>投诉类型分布</template>
              <div class="chart-container">
                <!-- 这里可以添加图表组件 -->
                <div class="chart-placeholder">投诉类型分布图表</div>
              </div>
            </el-card>
          </el-col>
          <el-col :span="12">
            <el-card>
              <template #header>处理时长统计</template>
              <div class="chart-container">
                <!-- 这里可以添加图表组件 -->
                <div class="chart-placeholder">处理时长统计图表</div>
              </div>
            </el-card>
          </el-col>
        </el-row>
      </div>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'

const loading = ref(false)
const totalComplaints = ref(0)
const pendingComplaints = ref(0)
const processingComplaints = ref(0)
const completedComplaints = ref(0)

const handleRefresh = () => {
  // 刷新统计数据
}

onMounted(() => {
  // 加载统计数据
})
</script>

<style scoped>
.complaint-statistics {
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.statistics-content {
  margin-top: 20px;
}

.stat-card {
  text-align: center;
}

.stat-item {
  padding: 20px;
}

.stat-number {
  font-size: 32px;
  font-weight: bold;
  color: #409eff;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #666;
}

.chart-container {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-placeholder {
  color: #999;
  font-size: 16px;
}
</style> 